package com.mdd.maduoduo.activity;

import android.view.View;
import android.widget.ImageView;
import android.widget.TextView;

import com.mdd.maduoduo.R;
import com.mdd.maduoduo.view.widget.BaseWebView;

import java.util.Objects;

public class WebViewActivity extends BaseActivity{

    private ImageView ivBack;

    private TextView tvTitle;

    private BaseWebView webView;

    @Override
    protected int getLayoutResId() {
        return R.layout.activity_web_view;
    }

    @Override
    protected void initView() {
        super.initView();
        ivBack = findViewById(R.id.ivBack);
        tvTitle = findViewById(R.id.tvTitle);
        webView = findViewById(R.id.webView);
        tvTitle.setText(getIntent().getStringExtra("title"));
        webView.loadUrl(Objects.requireNonNull(getIntent().getStringExtra("url")));
    }

    @Override
    protected void onClick() {
        ivBack.setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View view) {
                finish();
            }
        });
    }
}
